package com.itheima.health.utils;

import java.util.Random;

public class RandomCodeUtil {


    /**
     * 随机生成1-10之间的验证码
     * @return
     */
    public static String generateRandomCode() {
        StringBuilder code = new StringBuilder();
        Random random = new Random();
        for (int i = 0; i < 4; i++) {
            code.append(random.nextInt(10));
        }
        return code.toString();
    }
}
